import request from '@/utils/request'

/**
 * 【出租情况】下钻页 -- 出租详情
 */
 const rentOutListApi = (data) => {
	return request({
		url: '/portal-server/v1/api/rentout/rentOutList',
		method: 'post',
		data: data
	})
};

/**
 * 【出租情况】下钻页 -- 出租详情导出
 */
 const rentOutExportApi = (data) => {
	return request({
		url: '/portal-server/v1/api/rentout/rentOutExport',
		method: 'post',
		data: data,
        responseType: 'blob'
	})
};

/**
 * 【出租情况】下钻页 -- 出租详情 -- 品牌下拉选
 */
 const rentOutBrandDownApi = (biProjectCode) => {
	return request({
		url: `/portal-server/v1/api/rentout/rentOutBrandDown?biProjectCode=${biProjectCode}`,
		method: 'get',
	})
};

/**
 * 【出租情况】下钻页 -- 出租详情、空置详情 -- 楼栋下拉选
 */
 const vacancyBuildingDownApi = (biProjectCode) => {
	return request({
		url: `/portal-server/v1/api/rentout/vacancyBuildingDown?biProjectCode=${biProjectCode}`,
		method: 'get',
	})
};

/**
 * 【出租情况】下钻页 -- 出租详情、出租详情 -- 楼层下拉选
 */
 const vacancyFloorDownApi = (biProjectCode) => {
	return request({
		url: `/portal-server/v1/api/rentout/vacancyFloorDown?biProjectCode=${biProjectCode}`,
		method: 'get',
	})
};

/**
 * 【出租情况】下钻页 -- 出租详情 -- 单元编号下拉选
 */
 const rentOutUnitDownApi = (biProjectCode) => {
	return request({
		url: `/portal-server/v1/api/rentout/rentOutUnitDown?biProjectCode=${biProjectCode}`,
		method: 'get',
	})
};

/**
 * 【出租情况】下钻页 -- 出租详情 -- 商户名称下拉选
 */
 const rentOutDealerDownApi = (biProjectCode) => {
	return request({
		url: `/portal-server/v1/api/rentout/rentOutDealerDown?biProjectCode=${biProjectCode}`,
		method: 'get',
	})
};

/**
 * 【出租情况】下钻页 -- 出租详情 -- 合同编号下拉选
 */
 const rentOutContractNumberDownApi = (biProjectCode) => {
	return request({
		url: `/portal-server/v1/api/rentout/rentOutContractNumberDown?biProjectCode=${biProjectCode}`,
		method: 'get',
	})
};

/**
 * 【出租情况】下钻页 -- 出租详情 -- 合同状态下拉选
 */
 const rentOutContractStatusDownApi = (biProjectCode) => {
	return request({
		url: `/portal-server/v1/api/rentout/rentOutContractStatusDown?biProjectCode=${biProjectCode}`,
		method: 'get',
	})
};


/**
 * 【出租情况】下钻页 -- 空置详情
 */
 const vacancyListApi = (data) => {
	return request({
		url: '/portal-server/v1/api/rentout/vacancyList',
		method: 'post',
		data: data
	})
};

/**
 * 【出租情况】下钻页 -- 空置详情导出
 */
 const vacancyExportApi = (data) => {
	return request({
		url: '/portal-server/v1/api/rentout/vacancyExport',
		method: 'post',
		data: data,
        responseType: 'blob'
	})
};

/**
 * 【出租情况】下钻页 -- 空置详情 -- 单元编号下拉选
 */
 const vacancyUnitDownApi = ({biProjectCode, dataTime}) => {
	return request({
		url: `/portal-server/v1/api/rentout/vacancyUnitDown?biProjectCode=${biProjectCode}&dataTime=${dataTime}`,
		method: 'get',
	})
};


export default {
    rentOutListApi,
    rentOutExportApi,
    rentOutBrandDownApi,
    vacancyBuildingDownApi,
    vacancyFloorDownApi,
    rentOutUnitDownApi,
    rentOutDealerDownApi,
    rentOutContractNumberDownApi,
    rentOutContractStatusDownApi,
    vacancyListApi,
    vacancyExportApi,
    vacancyUnitDownApi,
}
